/** 
 * Copyright 2010 Erlacher Felix, Estgfaeller Wolfgang, Ferula Patrick
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package at.socialconference.app.model;

import android.os.Parcel;
import android.os.Parcelable;
import at.socialconference.inter.model.Place;

public class APlace extends Place implements Parcelable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public APlace(Parcel in) {
		super.setId(in.readInt());
		super.setName(in.readString());
		super.setDescription(in.readString());
		super.setLatitude(in.readDouble());
		super.setLongitude(in.readDouble());
	}

	public APlace(Place place) {
		super();
		super.setId(place.getId());
		super.setName(place.getName());
		super.setDescription(place.getDescription());
		super.setLatitude(place.getLatitude());
		super.setLongitude(place.getLongitude());
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(getId());
		dest.writeString(getName());
		dest.writeString(getDescription());
		dest.writeDouble(getLatitude()!=null?getLatitude():0);
		dest.writeDouble(getLongitude()!=null?getLongitude():0);
	}
	
	public static final Parcelable.Creator<APlace> CREATOR = new Parcelable.Creator<APlace>() 
	{ 
		public APlace createFromParcel(Parcel in) 
		{ 
			return new APlace(in); 
		} 

		public APlace[] newArray(int size) 
		{ 
			return new APlace[size]; 
		} 
	};


}
